NavUtils

NavUtils provides helper functionality for applications implementing recommended Android UI navigation patterns. For information about recommended navigation patterns see Tasks and Back Stack from the developer guide and Navigation from the design guide.

Properties

Link copied to clipboard
val PARENT_ACTIVITY: String = "android.support.PARENT_ACTIVITY"

Functions

Link copied to clipboard
@Nullable
open fun getParentActivityIntent(@NonNull sourceActivity: @NonNull Activity): @Nullable Intent
Obtain an Intent that will launch an explicit target activity specified by sourceActivity's PARENT_ACTIVITY element in the application's manifest.
@Nullable
open fun getParentActivityIntent(@NonNull context: @NonNull Context, @NonNull componentName: @NonNull ComponentName): @Nullable Intent
@Nullable
open fun getParentActivityIntent(@NonNull context: @NonNull Context, @NonNull sourceActivityClass: @NonNull Class<out Any>): @Nullable Intent
Obtain an Intent that will launch an explicit target activity specified by sourceActivityClass's PARENT_ACTIVITY element in the application's manifest.
Link copied to clipboard
@Nullable
open fun getParentActivityName(@NonNull sourceActivity: @NonNull Activity): @Nullable String
Return the fully qualified class name of sourceActivity's parent activity as specified by a PARENT_ACTIVITY element within the activity element in the application's manifest.
@Nullable
open fun getParentActivityName(@NonNull context: @NonNull Context, @NonNull componentName: @NonNull ComponentName): @Nullable String
Return the fully qualified class name of a source activity's parent activity as specified by a PARENT_ACTIVITY element within the activity element in the application's manifest.
Link copied to clipboard
open fun navigateUpFromSameTask(@NonNull sourceActivity: @NonNull Activity)
Convenience method that is equivalent to calling navigateUpTo(sourceActivity, getParentActivityIntent (sourceActivity)).
Link copied to clipboard
open fun navigateUpTo(@NonNull sourceActivity: @NonNull Activity, @NonNull upIntent: @NonNull Intent)
Navigate from sourceActivity to the activity specified by upIntent, finishing sourceActivity in the process.
Link copied to clipboard
open fun shouldUpRecreateTask(@NonNull sourceActivity: @NonNull Activity, @NonNull targetIntent: @NonNull Intent): Boolean
Returns true if sourceActivity should recreate the task when navigating 'up' by using targetIntent.